package com.moon.back.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * CustomCacheProperties
 *
 * @author <a href="drakelee1221@gmail.com">LiGeng</a>
 * @version 1.0.0, 2025-04-09 14:04
 */
@Data
@Component
@ConfigurationProperties(prefix = "custom.cache")
//@RefreshScope
public class CustomCacheProperties {

    /** 资产概览缓存查询的前缀名称  */
    public static String cacheAssetQueryName = "ASSET_OVERVIEW_DATA";
    /** 预警概览缓存查询的前缀名称  */
    public static String cacheSuperVisionQueryName = "SUPERVISION_OVERVIEW_DATA";

    /** 默认缓存默认失效分钟数 */
    private long defaultExpireMinutes = 60;

    /** 默认缓存数据的刷新分钟数，当每次查询时 ExpireMinutes - ttl 大于此时间就会异步查询刷新缓存数据 */
    private long defaultRefreshMinutes = 30;
    
    /** 特定名称的缓存默认失效分钟数 */
    private Map<String, Long> specialExpireMinutes;

    /** 特定名称的缓存数据的刷新分钟数 */
    private Map<String, Long> specialRefreshMinutes;
}
